package com.huawei.chenxuan;

/**
 * @program:IntelliJ IDEA
 * @Description:实现Judge接口
 * @author:Mr.CheCheHuiBujianO
 * @data: 2022/4/29 11:13
 */

public class JudgeIMPH implements Judge{

    @Override
    public String judge(int computerGuesture, int personGuesture) {
        if (personGuesture < 0 || personGuesture >2) {

        }
        int end = personGuesture-computerGuesture;
        String result = null;
        if (end == 0) result = "平局";
        else if (end == 1 || end == -2) result = "失败";
        else if (end == -1 || end == 2) result = "胜利";
        return result;
    }


}
